/**
 * Created by Administrator on 2015/1/25.
 */

var logger = require('./logger');

module.exports.Message = {
    ILLEGAL_REQUEST: "非法的请求来源",
    COMMAND_HELP: "使用该命令请回复：\n",
    ILLEGAL_WORD_UNEUQAL: "人类与魂词语长度不一致",
    GAME_NEW_SUCCESS: "新游戏创建成功，游戏号：",
    GAME_NOT_EXIST: "游戏号：%0不存在，请检查！",
    GAME_ALREAD_START: "游戏已开始，不允许加入！",
    GAME_STARTED: "游戏已开始！",
    GAME_ALREAD_START: "游戏已开始，不允许加入！",
    GAME_ENDED: "游戏已结束，无法开始！",
    GAME_HAS_ROLE_WHEN_ING: "当前游戏状态: %1 无法获取角色",
    GAME_ALREAD_END: "游戏已结束！",
    GAME_NOT_HAVE_YOU: "你未加入该游戏！",
    JOIN_GAME_SUCCESS: "加入游戏:%0成功！",
    NICKNAME_SET_SUCCESS: "昵称设置成功！\n你好，%0",
    CREATEUSER_CAN_NOT_JOIN: "创建者不能加入游戏！",
    CREATEUSER_CAN_NOT_ROLE: "创建者没有角色！",
    CREATEUSER_CAN_START: "创建者才能执行开始游戏命令！",
    CREATEUSER_CAN_END: "创建者才能执行结束游戏命令！",
    SHOULD_SET_NICKNAME: "欢迎关注本公众号，请回复如下内容完成昵称的设置:\n%0",
    USER_LIMIT :"玩家人数请控制在4-14人"
};


module.exports.paraseMsg = function (msg, words) {
    var result = msg;
    for (var i = 0; i < words.length; i++) {
        var replace = "%" + i;
        result = result.replace(replace, words[i]);
    }
    return result;
}